<template>
  <a :href="href"> {{ value }} </a>
</template>

<script lang="ts" setup>
  import { computed } from 'vue';
  import { Row } from '../../elementUI';

  const props = defineProps<{
    relation?: string;
    row?: Row;
    value: string | boolean | number;
  }>();

  const href = computed<string | undefined>(() =>
    props.row ? (props.relation ? (props.row[props.relation] as string) : undefined) : undefined
  );
</script>

<style scoped></style>
